<?php
APP::uses('AppController', 'Controller');
class FrontendsController extends AppController {
	public $uses = array('Game', 'Category', 'Genre');
	public function index() {
		$this->loadModel('Game');
		$games = $this->Game->find('all',
			array(
				'limit' => 6,
				'conditions' => array('Game.view >=' => 1000),
				'contain' => array('Category')
			)
		);
		pr($games); exit;
		$this->set(compact('games'));
	}
	
	public function menu_category() {
		$categories = $this->Category->find('all',
			array(
				'recursive' => -1
			)
		);
		return $categories;
	}
	public function menu_genre() {
		$genres = $this->Genre->find('all',
			array(
				'recursive' => -1
			)
		);
		return $genres;
	}
}
?>